package com.train.myjavaee.controller;


import com.train.myjavaee.pojo.po.User;
import com.train.myjavaee.pojo.vo.UserLoginVo;
import com.train.myjavaee.service.UserService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * @author abubu
 * @date 2025/05/13
 */
@RestController
@RequestMapping("/user")
@RequiredArgsConstructor
public class UserController {

    private final UserService userService;


    /**
     * @param phone 手机号
     * @param password 密码
     * @Desc:用户登录
     * @return {@link String }
     */
    @PostMapping("/login")
    public String login(@RequestBody UserLoginVo vo) {
        return userService.login(vo.getPhone(), vo.getPassword());
    }

    @GetMapping("/hello")
    public String hello(){
        return "hello world";
    }
}
